CreateObjectExample1.java

public class CreateObjectExample1   
{    
void show()    
{    
System.out.println("Welcome to javaTpoint");    
}    
public static void main(String[] args)   
{    
//creating an object using new keyword   
CreateObjectExample1 obj = new CreateObjectExample1();   
//invoking method using the object  
obj.show();    
}    
}   



CreateObjectExample2.java

public class CreateObjectExample2  
{  
//constructor of the class    
CreateObjectExample2()    
{    
System.out.println("Welcome to javaTpoint");    
}    
public static void main(String[] args)   
{    
//creating an object using new keyword   
CreateObjectExample2 obj = new CreateObjectExample2();   
}    
}   
